﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;

namespace Himp.Platform
{
    /// <summary>
    /// 部门
    /// </summary>
    public class Dept : FullAuditedAggregateRoot<Guid>, IMultiTenant
    {
        /// <summary>
        /// 部门编码
        /// </summary>
        public string DeptCodg { get; set; }

        /// <summary>
        /// 部门名称
        /// </summary>
        public string DeptName { get; set; }

        /// <summary>
        /// 拼音助记码
        /// </summary>
        public string? Pinyincode { get; set; }

        /// <summary>
        /// 五笔助记码
        /// </summary>
        public string? Wubicode { get; set; }

        /// <summary>
        /// 排序号
        /// </summary>
        public int Srtno { get; set; }

        /// <summary>
        /// 上级科室
        /// </summary>
        public Guid? ParentId { get; set; }

        /// <summary>
        /// 上级科室
        /// </summary>
        public Dept? Parent { get; set; }

        /// <summary>
        /// 下级科室
        /// </summary>
        public List<Dept>? Children { get; set; }

        /// <summary>
        /// 确认标识
        /// </summary>
        public bool ConfirmedFlag { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public Guid? TenantId { get; set; }

        public Dept(string deptCodg, string deptName, int srtno, Guid? parentId)
        { 
            DeptCodg = deptCodg;
            DeptName = deptName;
            Srtno = srtno;
            ParentId = parentId;
            ConfirmedFlag = false;
        }
    }
}
